package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.user.usertype.UserTypeQuery;
import com.uzai.console.entity.UserType;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface UserTypeMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(UserType record);

    int insertSelective(UserType record);

    UserType selectById(@Param("id") Long id, @Param("merId") Long merId);

    UserType selectDefault(@Param("merId") Long merId, @Param("groupId") Long groupId, @Param("identity") Integer identity);

    Integer selectMaxUpSort(@Param("merId") Long merId, @Param("groupId") Long groupId);

    int updateSelective(UserType record);

    int update(UserType record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<UserType> findByList(Page<UserType> page, @Param("query") UserTypeQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<UserType> findByList(@Param("query") UserTypeQuery query);
}